package com.oa.system.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.security.core.GrantedAuthority;

import com.fasterxml.jackson.annotation.JsonIgnore;

@Entity
@Table(name = "t_group")
public class Group implements GrantedAuthority {
	private static final long serialVersionUID = -7755094110544594672L;

	@Id
	private Long id;
	@Column(nullable = false, length = 32)
	private String name;

	public Long getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	@JsonIgnore
	public String getAuthority() {
		return name;
	}

	@Override
	public String toString() {
		return name;
	}

}
